/**
 * signal.c
 * test signal and raise functions.
 * @author: zt 2013-09-06
 */
#include<stdio.h>
#include<signal.h>

typedef void (*SignalHandler)(int);

/* Signal:void (*signal(int sig, void (*func)(int)))(int); */
void sigHandler(int sig)
{
    printf("sigHandler called: %d\n", sig);
    return ;
}

void sigRaise(int sig)
{
    printf("start raise signal: %d\n", sig);
    raise(sig);   
}

int main(void)
{
    int sig = SIGABRT;
    SignalHandler handler = signal(sig, sigHandler);
    sigRaise(sig);
    
    getchar();
    return 0;   
}
